<?php

include_once 'wechatCallback.php';

$wechatObj = new wechatCallback();
if (isset($_GET["signature"]) && isset($_GET["timestamp"]) && isset($_GET["nonce"])) {
    if (!isset($_GET['echostr'])) {
        $wechatObj->responseMsg();
    } else {
        $wechatObj->valid();
    }
} else {
    //$url = "http://www.baidu.com";
    //header("Location:" . $url);
    //echo file_get_contents("https://mp.weixin.qq.com/mp/profile_ext?action=home&__biz=MzUzNzQzNDE1MA==#wechat_redirect");
    echo file_get_contents("http://106.14.146.102/WeChatResponse/err.html");
}